<template>
    <div>
        <h2>{{hb.a}}</h2>
        <p>{{hb.b}}</p>
        <span>{{hb.c}}</span>
        <span>{{hb.d}}</span>
        <a href="###">{{hb.e}}<i>{{hb.f}}</i></a>
        <button @click="handleSelect(ha)">更新</button>
    </div>
</template>
<script>
export default {
    props:['hb'],
    data(){
        return {
            myTime:null,
            ha:{a:'球球小学多元智能培养班',b:'主讲教师：待定',c:'海淀学清路金码大厦校区5',d:'2018-07-23至2018-08-17',e:'￥6880',f:'报名截止17天'},
        }
    },
    methods:{
        handleSelect(key) {
            this.$emit('getChangeb',key);
        }
    },
    beforeCreate(){
        console.log('1.创建前')
    },
    created(){
        console.log('2.创建后')
    },
    //挂载阶段
    beforeMount(){
        //骨架屏--技术
        console.log('3.挂载前')
    },
    //当页面加载完成，发起一个请求，写这里
    mounted(){
        //挂载成功相当于window.onload
        //请求--单次请求--轮询请求
        // this.myTime = setInterval(()=>{
        //     console.log('成功')
        // },1000)
        console.log('4.挂载成功')
    },
    //更新阶段：当data或props数据修改时触发
    beforeUpdate(){
        console.log('更新前')
    },
    updated(){
        console.log('更新后')
    },
    //卸载-销毁
    beforeDestroy(){
        console.log('卸载前');
        window.clearInterval(this.myTime);
    },
    destroyed(){
        console.log('卸载完成')
    }
}
</script>